<template>
  <div>
    <aside class="filter" style="top: 0px">
      <div class="filter-header">
        <a href="javascript" class="filter-nav">
          <span >综合排序</span>
          <svg viewBox="0 0 72 32" class="dropdown-icon">
            <path d="M36 32l36-32h-72z">
            </path>
          </svg>
        </a>
        <a
           ubt-click="104723" ubt-data-type="1"
           ubt-data-is_svip="true" class="filter-nav"
           v-bind:class="{active: 5==orderBy }"
           @click="setIsActive(5)">
          <span >距离最近</span>
        </a>
        <a
           ubt-click="104723" class="filter-nav"
           v-bind:class="{active: 1==orderBy }"
           @click="setIsActive(1)">
          <span >品质联盟
          </span>
        </a>
        <a ubt-click="104725" href="javascript:" class="filter-nav-more">
          <span>
            筛选
          </span>
          <svg class="filter-nav-more__icon">
            <use xlink:href="#more-filter">
            </use>
          </svg>
        </a>
      </div>
    </aside>
  </div>
</template>

<script>
  import {mapGetters} from 'vuex'
  export default {
        name: "restaurant-filter",
      computed:{
        ...mapGetters({
          orderBy : 'getOrderBy'
        })
      },
      methods:{
          setIsActive(idx){
            this.$store.commit('setOrderBy',idx)
          },
      }
    }
</script>

<style scoped>
  /*过滤选项*/
  a {
    outline: 0;
    color: inherit;
    text-decoration: none;
  }
  .filter {
    position: relative;
    border-bottom: 1px solid #ddd;
    line-height: 1.04rem;
    line-height: 10.4vw;
    z-index: 101;
    height: 1.066667rem;
    height: 10.666667vw;
  }
  .filter-header {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100%;
    height: 1.053333rem;
    height: 10.533333vw;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    z-index: 4;
    background-color: #fff;
  }
  .filter-nav {
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    -ms-flex: 1;
    flex: 1;
    text-align: center;
    color: #666;
    position: relative;
    font-size: .6rem;
    z-index: 101;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .filter-nav .dropdown-icon {
    width: .16rem;
    width: 1.6vw;
    height: .08rem;
    height: .8vw;
    margin-left: .133333rem;
    margin-left: 1.333333vw;
    margin-bottom: .053333rem;
    margin-bottom: .533333vw;
    fill: #333;
    will-change: transform;
    -webkit-transition: -webkit-transform .3s;
    transition: -webkit-transform .3s;
    transition: transform .3s;
    transition: transform .3s,-webkit-transform .3s;
  }
  .filter-nav.active {
    color: #333;
    font-weight: 700;
  }
  .filter-nav-more {
    width: 2.133333rem;
    width: 21.333333vw;
    height: 1.066667rem;
    height: 10.666667vw;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    color: #666;
    font-size: .373333rem;
    position: relative;
  }
  .filter-nav-more__icon {
    margin-left: .053333rem;
    margin-left: .533333vw;
    width: .346667rem;
    width: 3.466667vw;
    height: .346667rem;
    height: 3.466667vw;
    fill: #666;
  }
</style>
